# include <iostream>
using namespace std;

int add(int a, int b){
    cout << "add(int, int) called, a + b = " << a + b << endl;
    return a + b;
}

int main() {
    int x = 10, y = 20;
    int (*pf)(int, int);
    pf = add;
    printf("add(x,y) = %d\n", add(x,y));
    printf("*pf(x,y) = %d\n", pf(x,y));
    printf("add = %p\n", add);
    printf("*add = %p\n", *add);
    printf("pf = %p\n", pf);
    printf("*pf = %p\n", *pf);
    printf("&pf = %p\n", &pf);
    printf("&*pf = %p\n", &*pf);

// add(int, int) called, a + b = 30
// add(x,y) = 30
// add(int, int) called, a + b = 30
// *pf(x,y) = 30
// add = 0x5d7a53962249
// *add = 0x5d7a53962249
// pf = 0x5d7a53962249
// *pf = 0x5d7a53962249
// &pf = 0x7ffd34eebfc0
// &*pf = 0x5d7a53962249

    cout << "add(x,y) = " << add(x,y) << endl;
    cout << "*pf(x,y) = " << (*pf)(x,y) << endl;
    cout << "add = " << add << endl;
    cout << "*add = " << *add << endl;
    cout << "pf = " << pf << endl;
    cout << "*pf = " << *pf << endl;
    cout << "&pf = " << &pf << endl;
    cout << "&*pf = " << &*pf << endl;
    return 0;
}